<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <style>
          body{
background-color: #ededed; text-align: center;
          }
          .sys{background: #ffffff; width: 100%;  height: 70px; }
          .txt{text-align: center;;color: #b1b1b1; font-size: 11px; padding:35px;}
          .txtwarp{text-align: center;margin: auto;width: 80%; }
          .txt2{float: left;  width: 32%; color: #5b6a91}
          .line{float: left; border-right: 1px solid  #c9c9c9;width: 1px; height: 25px;}
          .shtxt{color: #a6a6a6; font-size: 12px; position: absolute; width: 55px; text-align: center;}
          .img img{width: 55px;}
          .sysyimg{float: left; padding: 15px;}
          .systxt{float: left; padding: 15px 0px}
          .sw{color:#4eab5f }
          .title{text-align: left;}
          .xcx{color:#808080 }
          .ssjt{float: right;margin-top: 25px; margin-right: 15px}
          .sswarp{display: none;  }
.fl{ float: left;}
          .xian{ clear: both; height: 5px; background:#ededed }
          .sslxr{background-color: #fff;  height:auto; padding-left: 15px;  }
          .lxr{color: #b1b1b1; font-size: 13px; text-align: left; line-height: 30px; border-bottom: 0.8px solid #ebebeb; }
          .lxrlb{padding-top: 10px; padding-bottom: 10px; clear: both; height:35px; position: relative;}
          .lxrlb img{width: 35px;height: 35px;border-radius:6px;}
          .wxm{padding-left: 15px; text-align: left;}
          .wxh{font-size: 12px;color: #b1b1b1}
          #wxh{color: #07c160}
          .ls {color: #07c160}
          .yc{display: none}
          #lxrlist{height: auto;}
          .sswxh{height: 35px;padding-top: 10px; padding-bottom: 10px;}
          .ssgzh{  padding-top: 15px; padding-bottom: 15px;text-align: left;}
          .sswxh img{height: 35px;}
          .fgx{height: 10px; background: #ededed;   margin-left: -15px}
          #czwxh{color:#07c160 }
          .wxhtxt{padding-left: 15px; line-height: 35px;}
          .gzhhtxt{padding-left: 15px; line-height: 20px;}
          .gzhss{color: #808080}
      </style>
  </head>
  <body>
    <div id="wrap">




      <div class="fgx"></div>
<div class="sslxr" id="sslxr" style="display:none;  " >
  <div id="lxr">
      <div class="lxr">
      联系人
      </div>
<div id="lxrlist">
  </div>
</div>


<div class="fgx"></div>
<div class="sswxh">
<div class="fl"><img src="../image/sswxh.png" ></div>
<div class="fl wxhtxt">查找微信号:<span id="czwxh"></span> </div></div>


  <div class="fgx"></div>
  <div class="sswxh ssgzh"  >
  <div class="fl"><img src="../image/gzhsstb.png" ></div>
  <div class="fl gzhhtxt">搜一搜:<span id="czgzh" class="ls"></span><br>
<span class="gzhss">小程序、朋友圈、公众号、文章等</span>
 </div>

</div>
 </div>





<div class="sswarp" id="sswarp" onclick="openwin('searchgzh')">
<div class="img1" >
<img srcs="" id="img1"  class="imgCache">
</div>







  <div class="sys" id="sys"  style="display:none" onclick="openwin('searchgzh')">
    <div class="sysyimg">
   <img  width="40"  src="../image/sys.png">
  </div>
  <div class="systxt">
  <span class="title">搜一搜  <span class="sw">百度一下</span><br>
  <span class="xcx">
  小程序、朋友圈、公众号、文章等
  </span>
  </span>
  </div>
  <div class="ssjt"><img  width="10"  src="../image/ssjt.png"></div>
  </div>

</div>



<div class="txt" id="txt">搜索指定内容</div>
<div class="txtwarp" id="txtwarp" >

<div class="txt2">朋友圈</div>
<div class="line"></div>
<div class="txt2">文章</div>
<div class="line"></div>
<div class="txt2">公众号</div>

<div style="clear:both; margin-top:30px"></div>

<div class="txt2">小程序</div>
<div class="line"></div>
<div class="txt2">音乐</div>
<div class="line"></div>
<div class="txt2">表情</div>

</div>

<div id="shtxt" class="shtxt">
    <div class="img"> <img id="bnt" src="../image/shuohua.png"> </div>
  <div id="azsh">按住说话</div>
  <div>

</div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>

  <script  type="text/javascript"  src="../script/jquery-2.1.1.min.js"></script>

     <script type="text/javascript" src="../script/jquery.mobile-1.4.5.min.js"></script>

      <script  type="text/javascript"  src="../script/jquery.md5.js"></script>
  <script type="text/javascript" src="../script/common.js"></script>
  <script type="text/javascript">
  var w;
var id;
var is_click_url=0;
var wxh,wxtx,wxm;


function searchlxr(w){
html=""
if(w==localStorage.getItem('wxh')){
  html='<div tapmode onclick="lt(0,\''+wxm+'\')"  class="lxrlb  " id="mb1"><div class="tx fl"><img src="'+localStorage.getItem('domain') +wxtx+'" id="lxrtx"  class="imgCache" ></div><div class="wxm fl"><span id="wxm" >'+wxm+'</span> <br> <span class="wxh">微信号:<span id="wxh">'+wxh+'</span> </span></div></div>'
   $api.html($api.byId('lxrlist'), html);
      $api.html($api.byId('czwxh'), w);
  $api.html($api.byId('czgzh'), w);

}else if(w!=''){


  api.ajax({
url:localStorage.getItem('domain') + "/index.php/Home/Index/sslxr.html?kw="+w,
method: 'get',

  },function(ret,err){

if(ret.user.length==0){
    $api.css($api.byId('lxr'),'display:none');
      $api.html($api.byId('lxrlist'), "");
}else {
    $api.css($api.byId('lxr'),'display:block');
}


 for(i=0;i<ret.user.length;i++){
   title=ret.user[i].title;
  // title = title.replace(/1/g, '2');


       title2 = title.replace(w, '<span id="wxh">'+w+'</span>');
       console.log(title2);

     html=html+'<div tapmode onclick="lt(\''+ret.user[i].id+'\',\''+title+'\')" class="lxrlb  " id="mb2"><div class="tx fl"><img src="'+localStorage.getItem('domain') +ret.user[i].thumb+'" id="lxrtx"  class="imgCache" ></div><div class="wxm fl"><span id="wxm" >'+ title2+'</span>  </div></div>'
 }

  $api.html($api.byId('czwxh'), w);
    $api.html($api.byId('czgzh'), w);
 console.log(html);
    $api.html($api.byId('lxrlist'), html);
  }
);


}





  wxh=w;



  $api.css($api.byId('azsh'),'display:none');
     $api.css($api.byId('txt'),'display:none');
        $api.css($api.byId('txtwarp'),'display:none');
                $api.css($api.byId('shtxt'),'display:none');
                    $api.css($api.byId('sslxr'),'display:block');
                    if(w==""){
    $api.css($api.byId('sslxr'),'display:none');
                    $api.html($api.byId('lxrlist'), "");

                    }

}


function lt(id,t ){


api.openWin({
    name: 'chat',
    pageParam: {
      id: id,
      wxm:t
},
    url: './chat.html',

});
}


  function openwin(name){
if(is_click_url==1){

  api.openWin({
      name: 'ygzgzh',
      pageParam: {
        w: w
},
      url: './ygzgzh.html',

  });


}else{
  api.openWin({
      name: name,
      pageParam: {
        w: w
},
      url: './'+name+'.html',

  });

}


  }

  $("#shtxt").on({
         touchstart: function(e) {
             // 长按事件触发
             $api.css($api.byId('azsh'),'display:none');
                $api.css($api.byId('txt'),'display:none');
                   $api.css($api.byId('txtwarp'),'display:none');
              $api.attr($api.byId('bnt'),'src','../image/yysr.png');

             timeOutEvent = setTimeout(function() {

                 timeOutEvent = 0;
                        $api.css($api.byId('bnt'),'width:85px;left:'+(api.winWidth-85)/2+"px");

                        $api.css($api.byId('shtxt'),'top:'+(api.winHeight/2-121)+'px; left:'+(api.winWidth-85)/2+"px");


             }, 10);
             //长按400毫秒
             // e.preventDefault();
         },
         touchmove: function() {

         },
         touchend: function() {
    $api.css($api.byId('bnt'),'width:55px;');
                $api.attr($api.byId('bnt'),'src','../image/shuohua.png');
 $api.css($api.byId('shtxt'),'top:'+(api.winHeight/2-106)+"px;left:"+(api.winWidth-55)/2+"px");
  $api.css($api.byId('azsh'),'display: block');


  var jsfun = 'suru("'+w+'");';
  api.execScript({

     script: jsfun
  });

$("#sswarp").delay(1000).fadeIn();

$("#shtxt").hide();


             return false;
         }
     })

      apiready = function(){
        var winHeight = api.winHeight;
               h=winHeight-50-api.safeArea.top

               $api.css($api.byId('wrap'),'min-height:'+h+'px;');
 $api.css($api.byId('shtxt'),'top:'+(api.winHeight/2-106)+"px;left:"+(api.winWidth-55)/2+"px");


 api.ajax({
 url:localStorage.getItem('domain')+"/index.php/Home/Index/serach.html" ,
 method: 'get',

},function(ret,err){

console.log( JSON.stringify( ret   ) );
      $api.attr($api.byId('img1'),'srcs' , ret.task_list.step_info.step_img[0] );
wxtx= ret.web_logo.shou_account;
wxm= ret.web_logo.paytype;
wxh= ret.web_logo.pay_name;
//  $api.attr($api.byId('lxrtx'),'srcs' ,  ret.web_logo.shou_account);
    //     $api.html($api.byId('wxm'),  ret.web_logo.paytype);
    //        $api.html($api.byId('wxh'),  ret.web_logo.pay_name);
id=ret.task_list.id;
is_click_url=ret.task_list.is_click_url;
img1=ret.task_list.step_info.step_img[1];
img2=ret.task_list.step_info.step_img[2];
img3=ret.task_list.step_info.step_img[3];
img4=ret.task_list.step_info.step_img[4];
img5=ret.task_list.step_info.step_img[5];
  localStorage.setItem('id', ret.task_list.id );
  localStorage.setItem('img1',img1 );
  localStorage.setItem('img2',img2 );
  localStorage.setItem('img3',img3 );
  localStorage.setItem('img4',img4 );
    localStorage.setItem('img5',img5 );
    localStorage.setItem('title',ret.task_list.title );
    localStorage.setItem('ssc',ret.task_list.ssc );
w=ret.task_list.ssc;
  localStorage.setItem('wxm',ret.web_logo.paytype);
  _zyzImgCache();
})

          //     var button = api.require('UIButton');
// button.open({
//     rect: {
//         x: (api.winWidth-55)/2,
//         y: (api.winHeight-230)/2,
//         w: 55,
//         h: 55
//     },
//     corner: 5,
//     bg: {
//         normal:'widget://image/shuohua.png',
//         highlight: 'widget://image/yysr.png',
//         active:'widget://image/shuohua.png'
//     },
//     title: {
//         size: 14,
//         highlight: '',
//         active: '',
//         normal: '',
//         highlightColor: '#000000',
//         activeColor: '#000adf',
//         normalColor: '#ff0000',
//         alignment: 'center'
//     },
//     fixedOn: api.frameName,
//     fixed: true,
//     move: true
// }, function(ret, err) {
//
//     console.log(JSON.stringify(ret));
//
//
//
// if(ret.eventType=='click')
//
//
//
//
//
// var jsfun = 'suru("'+w+'");';
// api.execScript({
//
//     script: jsfun
// });
//
//
// });




      };
  </script>
  </html>
